% finds and returns synapse from connectome passed to function (as
% obj) which connects neurons In and Out - neuron In is located on neuronInId position in neuronInLayer layer
% and neuron Out is located on neuronOutId position in neuronOutLayer layer.
function syn = getSynapse(obj, neuronInId,neuronInLayer,neuronOutId,neuronOutLayer)
            for i=1:length(obj.synapses)
                if((obj.synapses(1,i).inputNeuronId == neuronInId) && (obj.synapses(1,i).inputNeuronLayer == neuronInLayer) && (obj.synapses(1,i).outputNeuronId == neuronOutId) && (obj.synapses(1,i).outputNeuronLayer == neuronOutLayer))
                    syn = obj.synapses(1,i);
                    break;
                end
            end
        end